<%@ taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core" %>
<%@ taglib prefix="fmt" uri="http://java.sun.com/jsp/jstl/fmt" %>
<span>Logged as:
<c:choose>
<c:when test="${empty pageContext.request.userPrincipal}">
Anonymous
</c:when>
<c:otherwise>
<b><c:out value="${pageContext.request.userPrincipal.name}" escapeXml="true"/></b>
<a href="${pageContext.request.contextPath}/db/logout">logout</a>
</c:otherwise>
</c:choose>
</span>